package com.zg.third.qcc.web;

import com.zg.common.core.R;
import com.zg.third.api.domain.req.ZtQccEnReq;
import com.zg.third.api.domain.vo.*;
import com.zg.third.qcc.service.QccService;
import com.zg.third.qcc.service.ZtQccService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.util.List;

@Api(tags = {"企查查接口"})
@RestController
@RequiredArgsConstructor
public class QccController {

    private final ZtQccService ztQccService;

    private final QccService qccService;

    @ApiOperation("通过企查查查询企业信息")
    @PostMapping("/un/qcc/getByCreditCode")
    public R<ZtQccEnterpriseInfoVo> getByCreditCode(@RequestBody @Valid ZtQccEnReq req) {
        ZtQccEnterpriseInfoVo qccEnterpriseInfoVo = ztQccService.getByCreditCode(req);
        return R.success(qccEnterpriseInfoVo);
    }

    @ApiOperation("行政处罚核查")
    @GetMapping("/un/qcc/adminPenaltyCheck")
    public R<Integer> adminPenaltyCheck(@RequestParam("keyword") String keyword) {
        Integer qccEnterpriseInfoVo = qccService.adminPenaltyCheck(keyword);
        return R.success(qccEnterpriseInfoVo);
    }

    @ApiOperation("立案信息核查")
    @GetMapping("/un/qcc/caseFilingCheck")
    public R<Integer> caseFilingCheck(@RequestParam("keyword") String keyword) {
        Integer qccEnterpriseInfoVo = qccService.caseFilingCheck(keyword);
        return R.success(qccEnterpriseInfoVo);
    }

    @ApiOperation("软件著作权查询")
    @GetMapping("/un/qcc/copyRight")
    public R<Integer> copyRight(@RequestParam("keyword") String keyword) {
        Integer qccEnterpriseInfoVo = qccService.copyRight(keyword);
        return R.success(qccEnterpriseInfoVo);
    }

    @ApiOperation("开庭公告核查")
    @GetMapping("/un/qcc/courtAnnoCheck")
    public R<Integer> courtAnnoCheck(@RequestParam("keyword") String keyword) {
        Integer qccEnterpriseInfoVo = qccService.courtAnnoCheck(keyword);
        return R.success(qccEnterpriseInfoVo);
    }

    @ApiOperation("客户查询")
    @GetMapping("/un/qcc/customer")
    public R<Integer> customer(@RequestParam("keyword") String keyword) {
        Integer qccEnterpriseInfoVo = qccService.customer(keyword);
        return R.success(qccEnterpriseInfoVo);
    }

    @ApiOperation("惩戒名单核查")
    @GetMapping("/un/qcc/disciplinaryCheck")
    public R<Integer> disciplinaryCheck(@RequestParam("keyword") String keyword) {
        Integer qccEnterpriseInfoVo = qccService.disciplinaryCheck(keyword);
        return R.success(qccEnterpriseInfoVo);
    }

    @ApiOperation("终本案件核查")
    @GetMapping("/un/qcc/endExecuteCaseCheck")
    public R<Integer> endExecuteCaseCheck(@RequestParam("keyword") String keyword) {
        Integer qccEnterpriseInfoVo = qccService.endExecuteCaseCheck(keyword);
        return R.success(qccEnterpriseInfoVo);
    }

    @ApiOperation("环保处罚核查")
    @GetMapping("/un/qcc/enterpriseInfo")
    public R<Integer> envPunishmentCheck(@RequestParam("keyword") String keyword) {
        Integer qccEnterpriseInfoVo = qccService.envPunishmentCheck(keyword);
        return R.success(qccEnterpriseInfoVo);
    }

    @ApiOperation("上市企业")
    @GetMapping("/un/qcc/ipo")
    public R<QccIpoVo> ipo(@RequestParam("keyword") String keyword) {
        QccIpoVo qccEnterpriseInfoVo = qccService.ipo(keyword);
        return R.success(qccEnterpriseInfoVo);
    }


    @ApiOperation("税务信用")
    @GetMapping("/un/qcc/taxCredit")
    public R<List<QccTaxCreditVo>> taxCredit(@RequestParam("keyword") String keyword) {
        List<QccTaxCreditVo> qccEnterpriseInfoVo = qccService.taxCredit(keyword);
        return R.success(qccEnterpriseInfoVo);
    }

    @ApiOperation("司法拍卖核查")
    @GetMapping("/un/qcc/judicialSaleCheck")
    public R<Integer> judicialSaleCheck(@RequestParam("keyword") String keyword) {
        Integer qccEnterpriseInfoVo = qccService.judicialSaleCheck(keyword);
        return R.success(qccEnterpriseInfoVo);
    }



    @ApiOperation("客户身份识别")
    @GetMapping("/un/qcc/kyc")
    public R<QccKycVo> kyc(@RequestParam("keyword") String keyword) {
        QccKycVo qccEnterpriseInfoVo = qccService.kyc(keyword);
        return R.success(qccEnterpriseInfoVo);
    }

    @ApiOperation("国有土地受让核查")
    @GetMapping("/un/qcc/landMergeCheck")
    public R<Integer> landMergeCheck(@RequestParam("keyword") String keyword) {
        Integer qccEnterpriseInfoVo = qccService.landMergeCheck(keyword);
        return R.success(qccEnterpriseInfoVo);
    }

    @ApiOperation("专利查询")
    @GetMapping("/un/qcc/patent")
    public R<Integer> patent(@RequestParam("keyword") String keyword) {
        Integer qccEnterpriseInfoVo = qccService.patent(keyword);
        return R.success(qccEnterpriseInfoVo);
    }

    @ApiOperation("公示催告核查")
    @GetMapping("/un/qcc/publishNoticeCheck")
    public R<Integer> publishNoticeCheck(@RequestParam("keyword") String keyword) {
        Integer qccEnterpriseInfoVo = qccService.publishNoticeCheck(keyword);
        return R.success(qccEnterpriseInfoVo);
    }

    @ApiOperation("严重违法核查")
    @GetMapping("/un/qcc/seriousIllegalCheck")
    public R<QccSeriousIllegalCheckVo> seriousIllegalCheck(@RequestParam("keyword") String keyword) {
        QccSeriousIllegalCheckVo qccEnterpriseInfoVo = qccService.seriousIllegalCheck(keyword);
        return R.success(qccEnterpriseInfoVo);
    }

    @ApiOperation("供应商查询")
    @GetMapping("/un/qcc/supplier")
    public R<Integer> supplier(@RequestParam("keyword") String keyword) {
        Integer qccEnterpriseInfoVo = qccService.supplier(keyword);
        return R.success(qccEnterpriseInfoVo);
    }
}
